// ================================================== //
// #			GameServer 1.00.90					# //
// #			Imagination Arts					# //
// #			Julia Project 1.1.x					# //
// ================================================== //
// #	http://imaginationarts.net/forum/			# //
// #	http://mu.raklion.ru/						# //
// ================================================== //

#ifndef CHAT_H
#define CHAT_H

#include "Logger.h"
#include "User.h"
#include "GMSystem.h"
#include "Prodef.h"

class cChat
{
public:
	cChat();
	~cChat();  
	bool WisperChat(LPOBJ gObj, PMSG_CHATDATA_WHISPER* lpMsg);
	bool ChatDataSend(LPOBJ gObj, PMSG_CHATDATA * lpChat);													   
	void MessageLog(int Type, sColor LogColor, sLogType LogType, LPOBJ gObj, char* Msg,...);	   
	void Message(int Type, LPOBJ gObj, char* Msg,...);		//Fixed
	void MessageProtected(int Type, LPOBJ gObj, char* Msg,...);		//Fixed
	void MessageAllLog(int Type, int Type2, sColor LogColor, sLogType LogType, LPOBJ gObj, char* Msg,...);
	void MessageAll(int Type, int Type2, LPOBJ gObj, char* Msg,...);		//Fixed
	void MessageAllProtected(int Type, int Type2, LPOBJ gObj, char* Msg,...); //Fixed

private:			
	void AntiInject(char* message); 											  
	bool CheckCommand(LPOBJ gObj, int Config, 
						cGmSystem::Commands Command, int NeedZen, 
						int NeedPcPoint, int NeedWCoin, int NeedWebPoints,
						int NeedLvl, int Filled, 
						int CheckPlayer, char *CommandName,
						char *CommandUsage, char *Msg);
	void TakeCommand(LPOBJ gObj, int NeedZen, int NeedPcPoint, int NeedWCoin, int NeedWebPoints, char *CommandName);
	void PrivateLog(LPOBJ gObj, char *Name, PMSG_CHATDATA_WHISPER* lpMsg, bool Success);
	void MassLog(LPOBJ gObj, char* Message); 
	void MsgSrv(LPOBJ gObj,char* Message, int Type2);	   
	bool GgCommand(LPOBJ gObj, char* Msg);		 
	bool VosklCommand(LPOBJ gObj, char* Msg);
	bool MoveCommand(LPOBJ gObj, char *Msg);
	bool PostCommand(LPOBJ gObj, char *Msg);	 
	bool TimeCommand(LPOBJ gObj);	  
	bool ReloadCommand(LPOBJ gObj, char *Msg);
	bool OnlineCommand(LPOBJ gObj, char *Msg);
	bool LevelCommand(LPOBJ gObj);	
	bool WareCommand(LPOBJ gObj, char *Msg);	
	bool CheckCommand(LPOBJ gObj, char *Msg);	  
	bool AddCommands(LPOBJ gObj, char *Msg, int Type); 	   
	bool AddMobCommand(LPOBJ gObj, char *Msg);
	bool CheckVIPCommand(LPOBJ gObj, char *Msg);	
	bool BuyVIPCommand(LPOBJ gObj, char *Msg);	
	bool VIPListCommand(LPOBJ gObj, char *Msg);	
	bool CheckTerritoryCommand(LPOBJ gObj, char *Msg);	
	bool BuyTerritoryCommand(LPOBJ gObj, char *Msg);	
	bool GuildPost(LPOBJ gObj, char *Msg);
	bool Core(LPOBJ gObj, char *Msg);

	bool TraceCommand(LPOBJ gObj, int Index);
	bool DiskCommand(LPOBJ gObj, int Index);  
	bool SummonCommand(LPOBJ gObj, int Index);

	bool BanPostCommand(LPOBJ gObj, char *Msg, int Index); 
	bool UnBanPostCommand(LPOBJ gObj, int Index); 
	bool BanAccCommand(LPOBJ gObj, char *Msg, int Index);  
	bool UnBanAccCommand(LPOBJ gObj, char *Msg); 
	bool BanCharCommand(LPOBJ gObj, char *Msg, int Index);  
	bool UnBanCharCommand(LPOBJ gObj, char *Msg);	

	bool SetCharCommand(LPOBJ gObj, char* Msg, int Index); 
	bool SetPKCommand(LPOBJ gObj, char *Msg, int Index);	
	bool SkinCommand(LPOBJ gObj, char *Msg, int Index);	
	bool DropCommand(LPOBJ gObj, char *Msg, int Index);	
	bool GmoveCommand(LPOBJ gObj, char *Msg, int Index);	
	bool StatusCommand(LPOBJ gObj, char *Msg, int Index); 
	bool PKClearCommand(LPOBJ gObj, char *Msg, int Index);	 
	bool SetDropCommand(LPOBJ gObj, char *Msg, int Index);	
	bool SetZenCommand(LPOBJ gObj, char *Msg, int Index);

	bool DisableChatCommand(LPOBJ gObj, char *Msg, int Index);	
	bool EnableChatCommand(LPOBJ gObj, int Index);

	bool VipOnCommand(LPOBJ gObj);
	bool VipOffCommand(LPOBJ gObj);

	bool OffTradeCommand(LPOBJ gObj);
	bool ResetCommand(LPOBJ gObj); 
	bool ExchangeCommands(LPOBJ gObj, char *Msg, int Type); 


	bool IsMarryCommand(LPOBJ gObj, char *Msg);
	bool MarryOnlineCommand(LPOBJ gObj);
	bool MarryTraceCommand(LPOBJ gObj);
	bool MarryDivorce(LPOBJ gObj);	

	bool YesCommand(LPOBJ gObj);
	bool NoCommand(LPOBJ gObj);
};

extern cChat Chat;


#endif